home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com
- Newsgroups: comp.lang.c++
- Subject: Re: a lady need help
- Date: 20 Jan 1996 22:38:13 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4drqsl$fjo@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe11.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 20, 1996 21:09:53 in article <a lady need help>, 'linda siu
- <103051.3457@CompuServe.COM>' wrote:
-
-
- >I lost my job and went for an interview lately.
- >
- >I am still confuse about some of the c++ question.
- >
- Was the job for a c++ programmer? Your questions are rather
- basic in natue -- nothing wrong with that, we all had to learn
- in the beginning -- indicate that you may want to stick to just
- straight C jobs for the time being. Of course, the fact that you're
- checking this newsgroup shows progress ::--)). In the right
- direction, I might add.
-
- >
- >a) What is a initialization list and when/how to use it.
- >
- An initialization list is used to specify values to be assigned
- to the data members of an object at creation time. In some
- cases, initialization list is required, in others it's just a convenience.
- For more info, consult any C++ book.
-
- >b) what is the advantage of new/delete over malloc/free.
- >
- malloc() only allocates raw memory. Any initializations for such
- memory must be performed explicitly after allocation. The new
- operator, on the other hand, not only allocates raw memory, but
- calls the applicable initializations on that memory to turn it into
- a bona-fide object. Again, for more info, consult any basic C++
- text.
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-